home *** CD-ROM | disk | FTP | other *** search
/ Computer Select (Limited Edition) / Computer Select.iso / dobbs / v17n04 / handprin.urc / (InkEdit) / InkApp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-05  |  2.0 KB  |  85 lines  |  [TEXT/KAHL]

  1. #include "Commands.h"
  2. #include "CBartender.h"
  3. #include "InkApp.h"
  4. #include "InkDoc.h"
  5. #include "Global.h"
  6.  
  7. extern    OSType        gSignature;
  8. extern    CBartender *gBartender;
  9.  
  10. #define        kExtraMasters        10
  11. #define        kRainyDayFund        45000
  12. #define        kCriticalBalance    40000
  13. #define        kToolboxBalance        20000
  14.  
  15. void RecognizerInit(void);
  16. void main()
  17.     {
  18.     InkApp    *editApp;    
  19.     editApp = new(InkApp);
  20.     editApp->IEditApp();
  21.     editApp->Run();
  22.     editApp->Exit();
  23.     }
  24.  
  25. void InkApp::IEditApp(void) {
  26.     CApplication::IApplication(kExtraMasters,kRainyDayFund,kCriticalBalance,kToolboxBalance);
  27.     RecognizerInit();
  28.     }
  29.  
  30. void InkApp::StartUpAction(short numPreloads) {
  31.     FlushEvents(everyEvent, 0);
  32.     }
  33.  
  34. void InkApp::SetUpFileParameters(void) {
  35.     inherited::SetUpFileParameters();    /* Be sure to call the default method */
  36.     sfNumTypes = 1;
  37.     sfFileTypes[0] = 'INKd';
  38.     gSignature = 'INKe';
  39.     }
  40.  
  41. void InkApp::CreateDocument() {
  42.     InkDoc    *theDocument = NULL;
  43.     TRY {
  44.         theDocument = new(InkDoc);
  45.         theDocument->IEditDoc(this, TRUE);
  46.         theDocument->NewFile();
  47.         }
  48.     CATCH {
  49.         ForgetObject( theDocument);
  50.         }
  51.     ENDTRY;
  52.     }
  53.  
  54. void InkApp::OpenDocument(SFReply *macSFReply) {
  55.     InkDoc    *theDocument = NULL;
  56.     TRY {    
  57.         theDocument = new(InkDoc);
  58.         theDocument->IEditDoc(this, TRUE);
  59.         theDocument->OpenFile(macSFReply);
  60.         }
  61.     CATCH {
  62.         ForgetObject( theDocument);
  63.         }
  64.     ENDTRY;
  65.     }
  66.  
  67. void InkApp::SetUpMenus(void) {
  68.     inherited::SetUpMenus();
  69.     AddResMenu(GetMHandle(MENUfont), 'FONT');
  70.     gBartender->SetDimOption(MENUfont, dimNONE);
  71.     gBartender->SetDimOption(MENUsize, dimNONE);
  72.     gBartender->SetDimOption(MENUstyle, dimNONE);
  73.     gBartender->SetUnchecking(MENUfont, TRUE);
  74.     gBartender->SetUnchecking(MENUsize, TRUE);
  75.     gBartender->SetUnchecking(MENUstyle, TRUE);
  76.     gBartender->SetDimOption(128, dimNONE);
  77.     gBartender->SetDimOption(129, dimNONE);
  78.     gBartender->SetDimOption(130, dimNONE);
  79.     gBartender->SetDimOption(131, dimNONE);
  80.     gBartender->SetDimOption(132, dimNONE);
  81.     gBartender->SetUnchecking(130, TRUE);
  82.     gBartender->SetUnchecking(131, TRUE);
  83.     gBartender->SetUnchecking(132, TRUE);
  84.     }
  85.